import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {Observable} from "rxjs/Observable";

@Injectable()
export class WebcastSearchListProvider {

    constructor(public http: HttpClient) {

    }

    /**
     * 根据关键字，获取搜索结果
     * @param keyWord 搜索关键字
     * @returns {Observable<Object>}
     */
    getSearchResultList(keyWord: string, pageNum: number, pageSize: number): Observable<any> {
        keyWord = keyWord.trim() ? keyWord : 'undefined';
        return this.http.get(`/livestreaming/v1/list/${keyWord}`);
    }
}
